package jt.com.jt809.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 消息体实体类
 *
 * @Author OuJiaJun
 * @Date 2024/4/22 15:13
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public final class Message {
    // 头标识
    private int headFlag;
    // 数据头
    private MessageHead msgHead;
    // 数据体
    private byte[] msgBody;
    // CRC校验码
    private byte[] crcCode;
    // 尾标识
    private int endFlag;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static final class MessageHead {
        // 数据长度(包括头标识、数据头、数据体和尾标识)
        private int msgLength;
        // 报文序列号
        private int msgSn;
        // 业务数据类型
        private short msgId;
        // 下级平台接入码
        private int msgGnssCenterId;
        private byte[] versionFlag;
        private int encryptFlag;
        private int encryptKey;
    }
}
